function ShowClassPhoto(classid,id) {

  var winClose = 0;
  if (window.ClassImage != null && ! ClassImage.closed)
  {
    ClassImage.close();
    winClose = 1;
  }

  if (window.ClassImage == null || ClassImage.closed || winClose)
  {
	url="../Class/ViewPhoto.asp?CLassID="+classid+"&PhotoID="+id;
    var w_opt="location=1,resizable=1,scrollbars=1,menubar=1,toolbar=1,status=1";
    ClassImage=window.open(url,"Preview",w_opt);

    if (window.ClassImage != null)
      ClassImage.focus();
  }

}

function ShowSchoolPhoto(id) {

  var winClose = 0;
  if (window.SchoolImage != null && ! SchoolImage.closed)
  {
    SchoolImage.close();
    winClose = 1;
  }

  if (window.SchoolImage == null || SchoolImage.closed || winClose)
  {
	url="SchoolAlbum.asp?Action=ShowPhoto&PhotoID="+id;
    var w_opt="location=1,resizable=1,scrollbars=1,menubar=1,toolbar=1,status=1";
    SchoolImage=window.open(url,"Preview",w_opt);

    if (window.SchoolImage != null)
      SchoolImage.focus();
  }

}


function zoomout()
{            
	var height1=photo.height;           
	var width1=photo.width;         
	height1=height1/1.2;
	width1=width1/1.2;
	if (width1<60||height1<60) return;
	photo.height=height1;
	photo.width=width1;        
}             
  
		  
function zoomin()
{            
	var height1=photo.height;
	var width1=photo.width;
	height1=height1*1.2;
	width1=width1*1.2;
	if (width1>660) return;
	photo.height=height1;       
	photo.width=width1;
}             
 

function fitpage(pwidth,pheight)
{
	var height1;
	var width1;
	if (pwidth<=660){
		height1=pheight;          
		width1=pwidth;
		}
	else
		{
		width1=660;
		height1=width1*pheight/pwidth;
		}
	photo.height=height1;
	photo.width=width1;
}


function ResizeImg(o)
{
	var width1=o.width;
	var height1=o.height;   
	var zoom=1+event.wheelDelta/2000;
	height1=height1*zoom;
	width1=width1*zoom;
	if (width1<60||width1>660) return;
	o.height=height1;
	o.width=width1;
}
